package com.polaris.live.viewmodel.live

import androidx.lifecycle.MutableLiveData
import com.polaris.live.common.mvvm.viewmodel.BaseViewModel
import com.polaris.live.common.network.request
import com.polaris.live.common.network.state.ResultState
import com.polaris.live.net.homeService
import com.polaris.live.resp.back_resp.DisplayUserBean
import com.polaris.live.resp.base.ListResp
import com.polaris.live.widget.refresh.OnListListener

/**
 * LivePartyGameDrawerViewModel
 *
 * @author Created by 天晴 on 2024/3/21/010 10:07
 */
class LivePartyGameDrawerViewModel : BaseViewModel(), OnListListener {

    var livesLiveData = MutableLiveData<ResultState<ListResp<DisplayUserBean>>>()

    override fun onRefresh() {
        request({ homeService.getSidebarPartyGameList(0) }, livesLiveData)
    }

    override fun onLoadMore(pageIndex: Int) {
        request({ homeService.getSidebarPartyGameList(pageIndex) }, livesLiveData)
    }

}